/**
 * Copyright 2015-2016 eyaomall.cn
 * All rights reserved.
 *
 * @project
 * @author jackey
 * @version 1.0
 * @date 2016-01-06
 */
package com.eyaomall.wxmall.dao;

import org.springframework.stereotype.Repository;

import com.eyaomall.wxmall.model.po.Collect;
import com.lycheeframework.core.annotation.NameSpace;
import com.lycheeframework.core.cmp.kit.PageHTTPObject;
import com.lycheeframework.core.cmp.kit.Pages;
import com.lycheeframework.core.support.DaoSupport;
/**
 * 我的收藏DAO
 * @author pro
 *
 */
@Repository
@NameSpace("collect")
public class CollectDao  extends DaoSupport<Collect>{
	
	/**
	 * 增加收藏
	 */
	public int create(Collect collect){
		super.insert(collect);
		return collect.getId();
	}
	
	/**
	 * 返会我的收藏分页
	 */
	public Pages<?> page(Collect collect, PageHTTPObject object) {
		return super.page(collect, object);
	}
	
	
	/**
	 * 删除我的收藏
	 */
	public boolean deleteByMemberId(int id){
		Collect collect = new Collect();
		collect.setId(id);
		collect.setIsDeleted("y");
		return super.update(collect)>0?true:false;
	}
}
